<template>
  <div class="header">
    <router-link tag="div" to="/" class="logo">我的商城管理平台</router-link>
    <el-menu
      :default-active="activeIndex2"
      class="el-menu-demo"
      mode="horizontal"
      router
      @select="handleSelect"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b">
      <el-submenu index="1">
        <template slot="title">我的工作台</template>
        <el-menu-item index="1-1">选项1</el-menu-item>
        <el-menu-item index="1-2">选项2</el-menu-item>
        <el-menu-item index="1-3" route="/login">退出登录</el-menu-item>
      </el-submenu>
    </el-menu>
  </div>
</template>

<script>
  export default {
    name:"HomeHeader",
    data() {
      return {
        activeIndex: '1',
        activeIndex2: '1'
      };
    },
    methods: {
      handleSelect(key, keyPath) {
        console.log(key, keyPath);
      }
    }
  }
</script>

<style lang="scss" scoped>
.header{
  height: 9vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: $bgColor;
}
  .logo{
    color: #fff;
    margin-left: 10px;
  }
  .el-menu-demo{
    border-bottom: none;
  }
</style>